﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.DUH
{
    class Class1
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重大疾病"))
            {
                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重症手足口病"))
            {
                double f = ppa.GetDutyTotalValue("重症手足口病保险金");
                if (f <= double.Epsilon)
                {
                    da.Value = ppa.Amount * 0.1;
                }
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.Period == ppa.PolicyActing.PeriodActings.Count() - 1)
            {
                da.Value = ppa.TotalFee * 1.08;
            }
        }
    }
}
